﻿using InternetSpiderLib;
using System;
using System.Collections.Generic;
using System.Text;

namespace WeChatGZHTextExtractor.Scenes
{
    /// <summary>
    /// 列表数据提取器
    /// </summary>
    public class ListExtractingSceneAction : ISceneAction
    {
        private List<ISceneAction> SceneActions = new List<ISceneAction>();

        public ListExtractingSceneAction(IEnumerable<ISceneAction> list)
        {
            if (list != null)
                SceneActions.AddRange(list);
        }

        public ListExtractingSceneAction(params ISceneAction[] list)
        {
            if (list != null)
                SceneActions.AddRange(list);
        }

        public void Run(DataBox data)
        {
            foreach (var item in SceneActions)
            {
                item?.Run(data);
            }
        }
    }
}
